//
//  NYMessageTableViewCell.m
//  Nooryes
//
//  Created by baken on 2020/3/1.
//  Copyright © 2020 MyApp. All rights reserved.
//

#import "NYMessageTableViewCell.h"
#import "NYMessageListModel.h"

@interface NYMessageTableViewCell()
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *date;
@property (weak, nonatomic) IBOutlet UILabel *content;
@property (weak, nonatomic) IBOutlet UIImageView *img;

@end

@implementation NYMessageTableViewCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    NYMessageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kNYMessageTableViewCell];
    if (!cell) {
        cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].firstObject;
    }
    return cell;
    
}

-(void)setModel:(MessageListModel *)model{
    _model = model;
    self.name.text = model.title;
    self.date.text = model.dateline;
    self.content.text = model.content;
    [self.img sd_setImageWithURL:[NSURL URLWithString:model.image]];
}

@end
